<?php
/**
 * @package qBase
 * @subpackage web
 */

/**
 * QWebSearchText
 * 
 * @package qBase
 * @subpackage web
 */
class QWebSearchText extends QWebControl 
{
	/**
	 * The results box
	 *
	 * @var QWebControl
	 */
	public $resultsBox = null;
	
	public $inputName = null;
	public $inputValue = null;

	public $results = null;
	
	// public $limitedResults = null;

	public function init()
	{
		$this->resultsBox = new QWebControl("resultsBox");
		$this->addControl($this->resultsBox);
		
		$this->setTemplate("web_search_text.tpl");
		$this->resultsBox->setTemplate($this->res("web_search_text_results.tpl"), false);
		
		$this->addCss("web_search_text.css");
		
		// $this->resultsBox->setAttribute("class", "__QWebSearchTextResults");
		$this->setAttribute("style", "z-index: 0;");
		
	}
	
	public function setSearchResults($results, $has_changed = false)
	{
		$this->results = $results;

		$this->setJsParam("results", $this->results, true);

		if ($has_changed)
			$this->resultsBox->setChanged(true);
	}
	
	public function setInputName($name)
	{
		$this->inputName = $name;
	}
}

?>